import { createApp,Directive } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './style.css'
import App from './App.vue'
import router from './router/index'
import store from './store'
import storage from './utils/storage'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import TreeMenu from "@/components/TreeMenu.vue"

console.log('打印环境变量',import.meta.env)

const app = createApp(App)

// 自定义指令
import * as directive from '@/directive';

Object.keys(directive).forEach((key) => {
  app.directive(key, (directive as { [key: string]: Directive })[key]);
});
// 注册全局组件
app.component("TreeMenu",TreeMenu)
// 放在全局
app.config.globalProperties.$storage = storage

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}


app.use(router).use(store).use(ElementPlus).mount('#app')